package day1;

/**
 * @author oldliu
 * @since 1.0
 */
public class StrTest3 {
    public static void main(String[] args) {
        String s="我喜欢java and c";
        s=s.toUpperCase();
        //s.toLowerCase()
        System.out.println(s);
        String s2="我喜欢Java and C";
        System.out.println(s.equals(s2));
        //忽略大小写的比较
        System.out.println(s.equalsIgnoreCase(s2));
        System.out.println(">>>>>>>>>>");
        int v = s2.indexOf('v');
        System.out.println(v==-1?"没有":"V在位置？"+v);
        //从左往右
        int pos=s2.indexOf("and",9);
        System.out.println(pos);
        //从右往左，lastIndexOf
        int a = s2.lastIndexOf("a");
        System.out.println("a的最后一个位置："+a);
    }
}
